package com.ly.heart.service.impl;

import java.util.List;
import com.ly.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ly.heart.mapper.ContractWarehouseDetailEntityMapper;
import com.ly.heart.domain.ContractWarehouseDetailEntity;
import com.ly.heart.service.IContractWarehouseDetailEntityService;

/**
 * 销售合同清单明细Service业务层处理
 *
 * @author cxl
 * @date 2024-05-16
 */
@Service
public class ContractWarehouseDetailEntityServiceImpl implements IContractWarehouseDetailEntityService
{
    @Autowired
    private ContractWarehouseDetailEntityMapper contractWarehouseDetailEntityMapper;

    /**
     * 查询销售合同清单明细
     *
     * @param id 销售合同清单明细主键
     * @return 销售合同清单明细
     */
    @Override
    public ContractWarehouseDetailEntity selectContractWarehouseDetailEntityById(String id)
    {
        return contractWarehouseDetailEntityMapper.selectContractWarehouseDetailEntityById(id);
    }

    /**
     * 查询销售合同清单明细列表
     *
     * @param contractWarehouseDetailEntity 销售合同清单明细
     * @return 销售合同清单明细
     */
    @Override
    public List<ContractWarehouseDetailEntity> selectContractWarehouseDetailEntityList(ContractWarehouseDetailEntity contractWarehouseDetailEntity)
    {
        return contractWarehouseDetailEntityMapper.selectContractWarehouseDetailEntityList(contractWarehouseDetailEntity);
    }

    /**
     * 新增销售合同清单明细
     *
     * @param contractWarehouseDetailEntity 销售合同清单明细
     * @return 结果
     */
    @Override
    public int insertContractWarehouseDetailEntity(ContractWarehouseDetailEntity contractWarehouseDetailEntity)
    {
        contractWarehouseDetailEntity.setCreateTime(DateUtils.getNowDate());
        return contractWarehouseDetailEntityMapper.insertContractWarehouseDetailEntity(contractWarehouseDetailEntity);
    }

    /**
     * 修改销售合同清单明细
     *
     * @param contractWarehouseDetailEntity 销售合同清单明细
     * @return 结果
     */
    @Override
    public int updateContractWarehouseDetailEntity(ContractWarehouseDetailEntity contractWarehouseDetailEntity)
    {
        return contractWarehouseDetailEntityMapper.updateContractWarehouseDetailEntity(contractWarehouseDetailEntity);
    }

    /**
     * 批量删除销售合同清单明细
     *
     * @param ids 需要删除的销售合同清单明细主键
     * @return 结果
     */
    @Override
    public int deleteContractWarehouseDetailEntityByIds(String[] ids)
    {
        return contractWarehouseDetailEntityMapper.deleteContractWarehouseDetailEntityByIds(ids);
    }

    /**
     * 删除销售合同清单明细信息
     *
     * @param id 销售合同清单明细主键
     * @return 结果
     */
    @Override
    public int deleteContractWarehouseDetailEntityById(String id)
    {
        return contractWarehouseDetailEntityMapper.deleteContractWarehouseDetailEntityById(id);
    }
}
